﻿using bilibili下载.Interface;
using System;
using System.Globalization;
using System.Windows.Data;

namespace bilibili下载.Help
{
    public class StateConvert : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is State state)
            {
                switch (state)
                {
                    case State.None:
                        return "未下载";

                    case State.Await:
                        return "等待下载";

                    case State.Underway:
                        return "正在下载";

                    case State.Finish:
                        return "下载完毕";

                    default:
                        break;
                }
            }
            return value;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}